'use strict';

module.exports = app => {
  const { INTEGER, STRING, DECIMAL, DATE } = app.Sequelize;

  const library = app.model.define('Library', {
    id: {
      field: 'id',
      type: INTEGER,
      primaryKey: true,
    },
    beginTime: {
      field: 'begin_time',
      type: STRING(50),
    },
    endTime: {
        field: 'end_time',
        type: STRING(50),
    },
    perDayPay: {
      field: 'per_day_pay',
      type: DECIMAL(5,2),
    },
    createBy: { field: 'create_by', type: STRING(50), allowNull: true },
    createDate: { field: 'create_date', type: DATE, allowNull: true },
    updateBy: { field: 'update_by', type: STRING(50), allowNull: true },
    updateDate: { field: 'update_date', type: DATE, allowNull: true },
  },
    {
      timestamps:false,
      tableName: 'library',
      created_at: false,
      updated_at:false,
     
    });

  return library;
};

